/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.vnf.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "VNF_SERVICIO_GENERAL")
@NamedQueries({@NamedQuery(name = "ServicioGeneral.findAll", query = "SELECT s FROM ServicioGeneral s"), @NamedQuery(name = "ServicioGeneral.findByIdServicioGeneral", query = "SELECT s FROM ServicioGeneral s WHERE s.idServicioGeneral = :idServicioGeneral"), @NamedQuery(name = "ServicioGeneral.findByDescripcion", query = "SELECT s FROM ServicioGeneral s WHERE s.descripcion = :descripcion"), @NamedQuery(name = "ServicioGeneral.findByTipo", query = "SELECT s FROM ServicioGeneral s WHERE s.tipo = :tipo")})
public class ServicioGeneral implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_SERVICIO_GENERAL")
    private Long idServicioGeneral;
    @Column(name = "DESCRIPCION")
    private String descripcion;
    @Column(name = "TIPO")
    private String tipo;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "servicioGeneral", fetch = FetchType.LAZY)
    private TransaccionNoFinanciera transaccionNoFinanciera;

    public ServicioGeneral() {
    }

    public ServicioGeneral(Long idServicioGeneral) {
        this.idServicioGeneral = idServicioGeneral;
    }

    public Long getIdServicioGeneral() {
        return idServicioGeneral;
    }

    public void setIdServicioGeneral(Long idServicioGeneral) {
        this.idServicioGeneral = idServicioGeneral;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public TransaccionNoFinanciera getTransaccionNoFinanciera() {
        return transaccionNoFinanciera;
    }

    public void setTransaccionNoFinanciera(TransaccionNoFinanciera transaccionNoFinanciera) {
        this.transaccionNoFinanciera = transaccionNoFinanciera;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idServicioGeneral != null ? idServicioGeneral.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ServicioGeneral)) {
            return false;
        }
        ServicioGeneral other = (ServicioGeneral) object;
        if ((this.idServicioGeneral == null && other.idServicioGeneral != null) || (this.idServicioGeneral != null && !this.idServicioGeneral.equals(other.idServicioGeneral))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.vnf.be.ServicioGeneral[idServicioGeneral=" + idServicioGeneral + "]";
    }

}
